package cn.iocoder.yudao.module.system.controller.app.mail;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.controller.app.mail.vo.SendMailVo;
import cn.iocoder.yudao.module.system.service.mail.MailSendService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "前端 - 发送邮件")
@RestController
@RequestMapping("/system/mail-template")
public class MailController {

    @Resource
    private MailSendService mailSendService;



    @PostMapping("/send-mail-verification-code")
    @Operation(summary = "发送短信")
//    @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail-verification-code')")
    public CommonResult<Long> sendMailVerification(String mail) {
        return success(mailSendService.sendSingleVerification(mail));
    }

//    @PostMapping("/send-mail-code")
//    @Operation(summary = "发送短信")
////    @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail-verification-code')")
//    public CommonResult<Long> sendMailCode(@RequestBody @Valid SendMailVo vo) {
//        return success(mailSendService.sendMailCode(vo));
//    }
}
